package com.suns.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Arrays;
import java.util.List;

@Controller
public class SecondHomeWorkController {
    @GetMapping("/second")
    public String hello(Model model) {
        model.addAttribute("title", "Welcome to my site!");
        model.addAttribute("description", "This is my first Thymeleaf application.");
        model.addAttribute("gender","男");
        model.addAttribute("value",1);
        List<String> fruits = Arrays.asList("Apple", "Banana", "Cherry", "Date", "Elderberry");
        model.addAttribute("fruits", fruits);
        return "SecondHomeWork";
    }
}
